Since a data access speed of a large-capacity storage device is generally lower, the data processing speed between a computing device and a large-capacity storage device is very slow. Since cache has a fast data processing capability and commonly-used data are generally relatively centralized, the data processing capability can be improved quickly by arranging a cache between the computing device and the large-capacity storage device. Since the data processing capability of the cache is close to a processor's capability, it is possible to quickly receive the data sent by the processor and send the cached data quickly to the processor. Data that are not used in the cache will be flushed to the storage device through an interface connected to the storage device.
Since the cost of cache is higher, a cache with a suitable storage capacity will be arranged for purpose of economics of the computing device. This arrangement causes the storage capacity of the cache smaller than the storage capacity of the storage device. Therefore, it is impossible to store all data in the storage device in the cache. In an existing method of writing data to the large-capacity storage device, it is determined firstly whether data pages to be stored in the storage device exist in the cache. If there are data pages existing in the cache, the data are written into already-existing data pages. If the data pages do not exist in the cache, the data are written into a new cache page in the cache. Regarding data not often used in the cache, the data in the cache pages are flushed to the storage device at a proper time to keep data consistent.